<?php
// this is the index site for our einstein module
// it is automatically appended on the applications main ./index.php
// by the dPframework

// we check for permissions on this module
$canRead = !getDenyRead( $m );		// retrieve module-based readPermission bool flag
$canEdit = !getDenyEdit( $m );		// retrieve module-based writePermission bool flag

if (!$canRead) {			// lock out users that do not have at least readPermission on this module
	$AppUI->redirect( "m=public&a=access_denied" );
}

$AppUI->savePlace();	//save the workplace state (have a footprint on this site)

// retrieve any state parameters (temporary session variables that are not stored in db)

if (isset( $_GET['tab'] )) {
	$AppUI->setState( 'MasterDataIdxTab', $_GET['tab'] );		// saves the current tab box state
}
$tab = $AppUI->getState( 'MasterDataIdxTab' ) !== NULL ? $AppUI->getState( 'MasterDataIdxTab' ) : 0;	// use first tab if no info is available
$active = intval( !$AppUI->getState( 'MasterDataIdxTab' ) );						// retrieve active tab info for the tab box that
													// will be created down below
// we prepare the User Interface Design with the dPFramework

// setup the title block with Name, Icon and Help
$titleBlock = new CTitleBlock( 'Master data', 'masterdata48x48.png', $m, "$m.$a" );	// load the icon automatically from ./modules/einstein/images/
$titleBlock->addCell();

$titleBlock->show();	//finally show the titleBlock

// now prepare and show the tabbed information boxes with the dPFramework

// build new tab box object
$tabBox = new CTabBox( "?m=masterdata", $tab );
//$tabBox = new CTabBox( "?m=einstein", "{$dPconfigroot_dir->'root_dir'}/modules/einstein/", $tab );
$tabBox->add( 'mdstatus_view', 'Status' );			// add a subsite vw_idx_about.php to the tab box object with title 'About Albert'
$tabBox->add( 'mdtype_view'  , 'Type' );	// add another subsite to the tab box object
$tabBox->add( 'mdunit_list'  , 'Unit' );	// add another subsite to the tab box object
$tabBox->add( 'mdcurrency_list'  , 'Currency' );	// add another subsite to the tab box object
$tabBox->add( 'mdjobtitle_list'  , 'Job Title' );	// add another subsite to the tab box object
$tabBox->add( 'mddivision_list'  , 'Division' );	// add another subsite to the tab box object
$tabBox->add( 'mdcostcenter_list'  , 'Cost Center' );
$tabBox->add( 'classification/list'  , 'Classification' );
$tabBox->add( 'transportations/index' , 'Transportation' );
$tabBox->show();						// finally show the tab box

// this is the whole main site!
// all further development now has to be done in the files addedit.php, vw_idx_about.php, vw_idx_quotes.php
// and in the subroutine do_quote_aed.php
?>